//
//  TestViewController.swift
//  MZTool_Example
//
//  Created by gby on 2022/3/8.
//  Copyright © 2022 CocoaPods. All rights reserved.
//

import UIKit
import MZTool
//import FDFullscreenPopGesture

class TestViewController: MZBaseViewController {
    
    var scrol: UIScrollView = UIScrollView.init()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.white
//        self.mz_interactivePopMaxAllowedInitialDistanceToLeftEdge = 100
        self.view.addSubview(self.scrol)
        self.scrol.mz_scrollViewPopGestureRecognizerEnable = true
        self.scrol.frame = CGRect(x: 0, y: 0, width: self.view.mz.width, height: self.view.mz.height)
        self.scrol.contentSize = CGSize(width: self.view.mz.width * 2, height: self.view.mz.height * 1.5)
        let imgv = UIImageView.init(frame: self.scrol.bounds)
        imgv.layer.addSublayer(CALayer.mz.create_GradientLayer(imgv.mz.size, (CGPoint(x: 0, y: 0.5), CGPoint(x: 1, y: 0.5),
                                                                              [UIColor.white, UIColor.black, UIColor.red],
                                                                              [NSNumber.init(value: 0.0), NSNumber.init(value: 0.5), NSNumber.init(value: 1.0)])))
        self.scrol.addSubview(imgv)
        
        let loading = MZView_Loading.init(frame: CGRect.init(x: 0, y: 0, width: 60, height: 60), loadType: .custom, "loading-2")
        loading.startAnimation()
        self.view.addSubview(loading)
        loading.center = CGPoint(x: self.view.bounds.width/2, y: 100)
        DispatchQueue.main.mz.after(5) {
            loading.stopAnimation()
            self.view.sendSubviewToBack(loading)
        }
        
        DispatchQueue.main.mz.after(7) {
            loading.startAnimation()
        }
        
        let labview = MZView_Labels.init(frame: CGRect.init(x: 0, y: 100, width: 300, height: 10)).update_Config { config in
            config.textfont = 12
            config.textcolor = MZ.RGB("#343434")
            config.labBgColor = MZ.RGB("#F4F4F4")
            config.labBorderColor = MZ.RGB("#E5E5E5")
            config.labWidth = 1
            config.space = 10
        }
        labview.labels = ["123123","fsdafdsafasd","范德萨发了就离开的","丰都是否"]
        self.view.addSubview(labview)
        
        
        
        if let emptyView = RCEmptyViewOC.dataEmpty() {
            emptyView.contentViewY = 160 + MZ.Navi_Height()
            emptyView.autoShowEmptyView = false
            emptyView.titleStr = ""
            createEmptyBgViewWith(empty: UIView.mzEmpty(emptyView))
        }
        opEmptyBgView?.ly_startLoading()
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
